- 
                Notifications
    You must be signed in to change notification settings 
- Fork 377
FEATURE: Window Scrolling API (Offset/Keyset pagination) [Spring Data JDBC] #2149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            chrshnv
  wants to merge
  2
  commits into
  spring-projects:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
chrshnv:main
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    21ff326    to
    b717a00      
    Compare
  
    957a9e4    to
    66c9da0      
    Compare
  
    | i guess done. awaiting your reviews! | 
| I have a question about the KeysetScrollPosition specification. Should users use property names from POJO or column names from the database? | 
3b9807e    to
    9ce9c71      
    Compare
  
    Signed-off-by: Artemiy Degtyarev <chereshnyabtw@icloud.com> Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> add: StatementFactory new mode for scroll api Signed-off-by: Artemiy Degtyarev <chereshnyabtw@icloud.com> Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> add: basic keyset pagination support (without directions) Signed-off-by: Artemiy Degtyarev <chereshnyabtw@icloud.com> Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> add: test with two keys Signed-off-by: Artemiy Degtyarev <chereshnyabtw@icloud.com> Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> add: sorting for keys not in query Signed-off-by: Artemiy Degtyarev <chereshnyabtw@icloud.com> Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> add: limit support Signed-off-by: Artemiy Degtyarev <chereshnyabtw@icloud.com> Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> fix: more optimal pg query Signed-off-by: Artemiy Degtyarev <chereshnyabtw@icloud.com> Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> fix: remove second compare for one-key query Signed-off-by: Artemiy Degtyarev <chereshnyabtw@icloud.com> Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> add: me in headers! Signed-off-by: Artemiy Degtyarev <chereshnyabtw@icloud.com> Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> code: move to 'ReflectionUtils' Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> add: unit-test for two key query creation Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> fix: fix query generation for three or more keys Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> documentation Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> fix: query test fix Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> fix: invalid next scroll position building due to difference in property and column name Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> fix: remove unexpected sort creation when column already in sort Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> fix: use RelationalPersistentProperty.getName() instead of RelationalPersistentProperty.getColumnName().getReference() Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> fix: use RelationalPersistentProperty.getName() instead of RelationalPersistentProperty.getColumnName().getReference() Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> test: use property name instead of database column Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> fix: getColumnName.getReference -> getName Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> code: more beautiful query building Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> code: fix formatting Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> Fix: offset scrolling - calculate query offset by page size Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> Test: add tests for window keyset position after first page Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com>
    
  chrshnv 
      added a commit
        to chrshnv/spring-data-relational
      that referenced
      this pull request
    
      Oct 9, 2025 
    
    
      
  
    
      
    
  
Reformat keys extraction code. See spring-projects#2149 Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com>
    
  chrshnv 
      added a commit
        to chrshnv/spring-data-relational
      that referenced
      this pull request
    
      Oct 9, 2025 
    
    
      
  
    
      
    
  
Reformat 'applyScrollOrderBy'. See spring-projects#2149 Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com>
Reformat keys extraction code. See spring-projects#2149 Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com> Polishing. Reformat 'applyScrollOrderBy'. See spring-projects#2149 Signed-off-by: Artemiy Chereshnevvv <chereshnevvv4real@gmail.com>
| Thanks for your pull request. This is interesting but we don't have currently the bandwidth to evolve JDBC support. We will come back to this one next year or so. | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
This PR introduces an implementation of Window Scrolling API for Spring Data JDBC, providing efficient, index-friendly pagination over ordered datasets.
Unlike traditional offset pagination, the new API uses keyset (window) navigation, which enables constant-time performance even on large tables.
Example query: